home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CUJ9206.ARJ / 1006026A < prev    next >
Text File  |  1992-06-02  |  893b  |  39 lines

  1. //    TESTLOCK.C
  2. //
  3. //
  4. //    TESTLOCK is calls FAKELOCK to learn the return values it
  5. //    will create.  By writing down the input string and the return
  6. //    value they can be added to your program like they are in TESTPROG.
  7.  
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include "fakelock.h"
  12.  
  13. void main( void )
  14. {
  15.   char instr[96];            // input string
  16.   char *mesg = "\rEnter string to test FAKELOCK (empty string to end): ";
  17.   int  key;                // which lock to use
  18.   int  results;                // return value from FAKELOCK
  19.   char temp[96];            // tempory place to get which lock
  20.  
  21.   printf( mesg );
  22.   gets( instr );
  23.  
  24.   while ( strlen( instr ) > 0 )
  25.   {
  26.     printf("Which lock (1 or 2): ");
  27.     gets( temp );
  28.  
  29.     key = atoi( temp );
  30.  
  31.     results = FAKELOCK( instr, key );
  32.  
  33.     printf("FAKELOCK results : %d\n", results );
  34.  
  35.     printf( mesg );
  36.     gets( instr );
  37.   }
  38. }
  39.